<?php
$this->Html->addCrumb('Gallery','/gallery-'.$this->layout);
$this->Html->addCrumb('Videos', '/'.$this->layout.'/videos');
$this->Html->addCrumb('Add');
?>
<?php 
$this->Html->scriptStart(array('inline' => false));
echo '
      $(function(){
        $("#Video'. ucfirst($this->layout). 'AddForm").TWS_Form( {
          validate : {
          rules : {
            VideoCompanyId : {required : true, help : "This is the service company that the video is associated with."},
            VideoDescription : {required : true, help : "A brief description of the video."},
            VideoUrl : {required : true, help : "Link to video on YouTube.", url : true}
          }
          }});
        });
       ';
$this->Html->scriptEnd();
?>
<h1>Add Video</h1>

<?php echo '<div id="actionLink">'.$this->Html->link('Back to list of Videos',array('action'=>'index',$this->layout=>true)).'</div>'; ?>

<?php echo $this->element('errors', array('errors' => isset($errors)? $errors : null)); ?>
<?php

echo $this->TWSForm->create('Video',  array(
    'inputDefaults' => array(
        'div' => array('class'=>'row')),
        'class'=>'inlineForm',
        'type'=>'file'));
echo $this->TWSForm->input('company_id', array('name'=>'VideoCompanyId', 'type'=>'select', 'label'=>'<span class="required">*</span>Company', 'options'=>$options));
echo $this->TWSForm->input('description', array('rows'=>'5','cols'=>'60','name'=>'VideoDescription', 'label'=>'<span class="required">*</span>Description'));
echo $this->TWSForm->input('url', array('name'=>'VideoUrl', 'size'=>'60', 'type'=>'text','label'=>'<span class="required">*</span>Youtube link to video'));

echo $this->TWSForm->end( array("label"=>"Add", "class"=>"button"));


?>